import pandas as pd
from datetime import date
import numpy as np
from sklearn import preprocessing

import matplotlib.pyplot as plt
import seaborn as sns

sale_data = pd.read_csv('./data/001488_pre1.csv')

# print(sale_data)


def show_pair_plot(data):
    # cols = ['days',"out","last_day","last_2day","last_7day","sale_num"]
        #通过seaborn绘制散点图
    sns.pairplot(data,size=1.5)

def show_corr_coef(data):
    cols = ['days',"out","last_day","last_2day","last_7day","sale_num"]

    cm = np.corrcoef(data[cols].values.T)
    #设置字的比例
    sns.set(font_scale=1.5)
    #绘制相关系数图
    hm = sns.heatmap(cm,cbar=True,annot=True,square=True,fmt=".2f",
                     annot_kws={"size":15},yticklabels=cols,xticklabels=cols)


def show_line(data):
    plt.plot(data['days'],data['sale_num'])

# show_pair_plot(sale_data)

# show_corr_coef(sale_data)

show_line(sale_data)

plt.show()
